<!DOCTYPE html>
<html lang="en">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<meta
			name="viewport"
			content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0,user-scalable=no"
		/>
		<meta name="format-detection" content="telephone=no" />
		<meta name="format-detection" content="email=no" />
		<meta http-equiv="Pragma" content="no-cache" />
		<meta http-equiv="Cache-Control" content="no-cache" />
		<meta http-equiv="Expires" content="0" />
		<title>身份审核</title>
		<!-- 引入 vant UI 组件库样式文件 -->
		<link rel="stylesheet" href="../common/css/vant-index.css" />
		<style type="text/css">
			body,
			html {
				background-color: #f3f3f5;
				height: 100%;
			}
			.audit {
				background-color: #fff;
				height: 100%;
				padding: 0.83rem 1.18rem;
				display: flex;
				flex-direction: column;
				align-items: center;
			}
			.van-button--info {
				background-color: #e22e30;
				border-color: #e22e30;
				font-size: 18px;
			}
		</style>
	</head>

	<body>
		<div id="app" v-cloak style="height: 100%">
			<div class="audit" v-if="status == 2">
				<img
					src="./img/waitAudit.png"
					style="width: 1.46rem; height: 1.46rem"
				/>
				<h2 style="font-size: 0.33rem">已提交，待审核</h2>
				<p style="font-size: 0.29rem">
					{{detail.doctorsVerifyTime.substring(0,10)}}
				</p>
				<p style="font-size: 0.29rem; text-align: center">
					您的资料已提交成功！我们将尽快审核，预计24小时返回审核结果，请随时留意短信通知及系统消息通知。
				</p>
				<van-button
					round
					type="info"
					block
					@click="comfirm"
					style="width: 5.21rem; height: 0.71rem; margin-top: 3.23rem"
					>进入首页</van-button
				>
			</div>
			<div class="audit" v-else>
				<img src="./img/unAudit.png" style="width: 1.46rem; height: 1.46rem" />
				<h2 style="font-size: 0.33rem">认证不通过</h2>
				<p style="font-size: 0.29rem">{{detail.doctorsVerifyTime}}</p>
				<p style="font-size: 0.29rem; text-align: center">
					医生您好，您的医生信息未通过认证，请到认证执医页重新提交认证申请。
					<span v-if="detail.remark">认证未通过原因：{{detail.remark}}。</span>
				</p>
				<van-button
					round
					type="info"
					block
					@click="back"
					style="width: 5.21rem; height: 0.71rem; margin-top: 3.23rem"
					>重新编辑</van-button
				>
			</div>
		</div>
	</body>
	<!-- 引入 rem -->
	<script src="../common/js/rem.js"></script>
	<!-- 上线环境用 -->
	<script src="../common/js/vue.global.prod.js"></script>
	<!-- 引入 UI 组件库 -->
	<script src="../common/js/vant.min.js"></script>
	<!-- axios 接口调用 -->
	<script src="../common/js/axios.min.js"></script>
	<script src="../base.js"></script>
	<script src="../common/js/url.min.js"></script>
	<script src="../common/js/rem.js"></script>

	<script type="module">
		import {
			getAction,
			postAction,
			spliceUrl,
		} from '../common/js/api/vue3-axios-utils.js'

		const audit = {
			data() {
				return {
					status: null,
					doctorId: '',
					detail: {},
				}
			},
			created() {
				this.doctorId = url('?id')
				this.getDetail()
			},
			methods: {
				getDetail() {
					postAction(spliceUrl('/201/02/2010201'), {
						doctorId: this.doctorId,
					}).then(res => {
						this.status = res.data.result.doctorsIsverify
						this.detail = res.data.result
						this.detail.doctorsVerifyTime = res.data.result.doctorsVerifyTime
							? res.data.result.doctorsVerifyTime.substring(0, 10)
							: ''
					})
				},
				back() {
					window.location.href = `editDoctorInfo.html?id=${this.doctorId}&status=${this.status}`
				},
				comfirm() {
					window.location.href = './doctorStudio.html'
				},
			},
		}

		const app = Vue.createApp(audit)

		app.use(vant)

		// 通过 CDN 引入时不会自动注册 Lazyload 组件
		// 可以通过下面的方式手动注册
		app.use(vant.Lazyload)

		// 调用函数组件，弹出一个 Toast
		// vant.Toast("刷新成功");

		app.mount('#app')
	</script>
</html>
